{extend name="base" /}

{block name="bodyer"}
				当前位置：
				<a href="<?php echo url('add'); ?>" class="layui-btn layui-btn-sm fr"><i class="layui-icon layui-icon-add-circle"></i> 添加用户</a>
				<span class="layui-breadcrumb" lay-separator="/">
					<a href="javascript:void(0);">用户管理</a>
					<a><cite>用户列表</cite></a>
				</span>

				<fieldset class="layui-elem-field layui-field-title">
					<legend>用户列表</legend>
				</fieldset>

				<table class="layui-table">
					<thead>
						<tr>
							<th>ID</th>
							<th>帐号</th>
							<th>性别</th>
							<th>所属角色</th>
							<th>登录时间</th>
							<th>登录次数</th>
							<th>登录IP</th>
							<th>排序</th>
							<th>状态</th>
							<th>创建时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php
					if (! empty($lists)):
						$gender = config('gender');
					?>
					<tbody>
						<?php foreach ($lists as $v): ?>
						<tr>
							<td><?php echo $v['id']; ?></td>
							<td><?php echo $v['username']; ?></td>
							<td><?php echo config('gender')[$v['gender']]; ?></td>
							<td><?php echo $v['Role']['name']; ?></td>
							<td><?php echo $v['login_time']; ?></td>
							<td><?php echo $v['login_num']; ?></td>
							<td><?php echo $v['login_ip']; ?></td>
							<td><?php echo $v['sort']; ?></td>
							<td><?php echo empty($v['status']) ? 'Off' : 'On'; ?></td>
							<td><?php echo $v['create_time']; ?></td>
							<td>
								<div class="layui-btn-group">
								<a title="编辑" href="<?php echo url('edit', array('id' => $v['id'])); ?>" class="layui-icon layui-btn layui-btn-sm layui-icon-edit"></a>
								<a title="删除" url="<?php echo url('del', array('id' => $v['id'])); ?>" class="layui-icon layui-btn layui-btn-sm layui-btn-danger layui-icon-delete"></a>
								</div>
							</td>
						</tr>
						<?php endforeach; ?>
					</tbody>
					<?php endif; ?>
				</table>
{/block}
